﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DAO;
using DTO;

namespace BUS
{
    public class NhaCungCapBUS
    {
        public List<NhaCungCapDTO> LayDSNhaCungCap()
        {
            NhaCungCapDAO nccDao = new NhaCungCapDAO();
            return nccDao.LayDSNhaCungCap();
        }
       
        public DataTable LoadNCC()
        {
            NhaCungCapDAO nccdao = new NhaCungCapDAO();
            DataTable dt = new DataTable();
            dt = nccdao.LayDSNCC();
            return dt;
        }

        public void ThemNCC(NhaCungCapDTO nccdto)
        {
            NhaCungCapDAO nccdao = new NhaCungCapDAO();
            nccdao.ThemNhaCungCap(nccdto);
        }
 

        public void CapNhatNCC(NhaCungCapDTO nccdto)
        {
            NhaCungCapDAO nccdao = new NhaCungCapDAO();
            nccdao.CapNhatNCC(nccdto);
        }

        public void XoaNCC(NhaCungCapDTO nccdto)
        {
            NhaCungCapDAO nccdao = new NhaCungCapDAO();
            nccdao.XoaNCC(nccdto);
        }
        public DataTable TimKiemNCC(string TenNCC, string SoDT, string Email)
        {
            DataTable dt = new DataTable();
            NhaCungCapDAO ncccdao = new NhaCungCapDAO();
            dt = ncccdao.TimNCC(TenNCC, SoDT, Email);
            return dt;
        }

    }
}
